nclude "match.h"

int Match::count=0;
Match::Match(const Match &m)
{
    for(int i=0;i<10;i++)member[i]=m.member[i];
	number=m.number;
	team=m.team;
	grade=m.grade;
}
void conclu(Match &m1,Match &m2)
{
	cout<<"比赛日期是 "<<m1.getdate()<<endl;
	cout<<"比赛队伍有 "<<"team "<<m1.getteam()<<" team "<<m2.getteam()<<endl;
	cout<<"team1成绩是 "<<m1.getgrade()<<"  team2成绩是 "<<m2.getgrade()<<endl;
	cout<<"team1人数是 "<<m1.getnumber()<<"  team2人数是 "<<m2.getnumber()<<endl;
	cout<<"team1的队员号码分别是 "<<endl;
	for(int i=0;i<10;i++)
	cout<<m1.getpeople(i)<<"  ";
	cout<<endl;
	cout<<"team2的队员号码分别是 "<<endl;
	for(int i=0;i<10;i++)
	cout<<m2.getpeople(i)<<"  ";
	cout<<endl;
	
}
void Match::change(int grade,int number,int team,int member[])
{
	this->grade=grade;
	this->number=number;
	this->team=team;
	for(int i=0;i<10;i++)this->member[i]=member[i];

}
Match::~Match()
{
	count--;
}
Group::Group(Match xm1,Match xm2):m1(xm1),m2(xm2)
{
	date=m1.getdate();
	number=m1.getnumber()+m2.getnumber();
	if(m1.getgrade()>m2.getgrade()) grade=m1.getgrade();
	else grade=m2.getgrade();


}
Group::~Group()
{
}
Group::Group(Group &g):m1(g.m1),m2(g.m2)
{
	date=g.date;
	number=g.number;
	grade=g.grade;
	cout<<"总人数: "<<number<<endl;
	cout<<"最高的成绩是: "<<grade<<endl;
}
void Print::compare(Match &m1,Match &m2)
{
	int a,b;
	a=m1.grade;
	b=m2.grade;
	cout<<"本次比赛  ";
	if(a<b)cout<<"Winner is team "<<m2.team<<endl;
	else cout<<"Winner is team "<<m1.team<<endl;
}
void Score::perscore(int grade,int number,int team,int member[],int score[])
{
	void change(int grade,int number,int team,int member[]);
	for(int i=0;i<10;i++)this->score[i]=score[i];
	cout<<"队伍是 "<<team<<endl;
	for(int i=0;i<10;i++)
	{
	 cout<<"队员"<<member[i]<<"的得分是: "<<score[i]<<"  ";
	 cout<<endl;
	}
}
